package echat.future.cn.echat.home.network

import echat.future.cn.echat.home.bean.*
import echat.future.cn.echat.my.utils.UserHelper.token
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *
 * Author  zhusx
 * Email   327270607@qq.com
 * Create  2018/8/24 9:11
 */
interface ApiService {
    @GET("/home/getBanner")
    fun getBanner()
            : Observable<JSONResult<List<BannerEntity>>>

    @POST("/api/index")
    fun homePage(@Query("token") token: String,
                 @Query("type") type: String,
                 @Query("gj") gj: String,
                 @Query("page") page: Int)
            : Observable<JSONResult<List<HomeEntity>>>

    //用户亲密榜
    @POST("/api/user/close_list")
    fun qinmibang(@Query("token") token: String,
                  @Query("member_id") member_id: String)
            : Observable<JSONResult<List<DearEntity>>>

    //用户礼物柜
    @POST("/api/user/present")
    fun liwugui(@Query("token") token: String,
                @Query("member_id") member_id: String)
            : Observable<JSONResult<PresentEntity>>

    //某个主播详情
    @POST("/api/user/get_one_anchor")
    fun get_one_anchor(@Query("token") token: String,
                       @Query("member_id") member_id: String)
            : Observable<JSONResult<AnchorEntity>>

    //主播视频
    @POST("/api/user/my_video")
    fun my_video(@Query("token") token: String,
                 @Query("member_id") member_id: String)
            : Observable<JSONResult<AnchorVideoEntity>>

    //关注（喜欢）/不喜欢/取消关注主播
    @POST("/api/user/ope_fans")
    fun openfans(@Query("token") token: String,
                 @Query("member_id") member_id: String,
                 @Query("type") type: String)
            : Observable<JSONResult<String>>

    //热门标签
    @POST("/api/user/auth_sign")
    fun auth_sign(@Query("token") token: String)
            : Observable<JSONResult<List<Apperance>>>

    //搜索
    @POST("/api/user/search")
    fun search(@Query("keywords") keywords: String)
            : Observable<JSONResult<List<HomeEntity>>>

    //观看付费视频
    @POST("/api/user/pay_video")
        fun pay_video(@Query("token") token: String,
                  @Query("anchor_id") member_id: String,
                  @Query("video_id") type: String)
            : Observable<JSONResult<Void>>


}